const bodyParser = require("body-parser");
const express = require("express");
const path = require("path");
const static = express.static;

//引入admin路由
let adminRouter = require("./routers/adminRouter");
let indexRouter = require("./routers/indexRouter");
let app = express();
//设置模板的路径
app.set("views", path.join(__dirname, "./views"));
//设置模板引擎
app.set("view engin", "ejs");
app.use(static("./static"));
app.use(
  bodyParser.urlencoded({
    extended: false,
  })
);
app.use("/admin", adminRouter);
app.use("/index", indexRouter);

app.listen(8989);
